#include "qsiimplot.h"
#include "qrealtimeplot.h"
#include <QCloseEvent>
#include <QHBoxLayout>
#include <QLabel>
#include "SiimData.h"
/*
#include <qwt_plot.h>
#include <qwt_plot_curve.h>
#include <qwt_plot_grid.h>
#include <qwt_symbol.h>
#include <qwt_legend.h>

#include <qapplication.h>
#include <qwt_scale_draw.h>
#include <QTime>

#include <qwt_plot_layout.h>
#include <qwt_plot_curve.h>
#include <qwt_scale_draw.h>
#include <qwt_scale_widget.h>
#include <qwt_legend.h>
#include <qwt_legend_label.h>
#include <qwt_plot_canvas.h>*/

QSiimPlot::QSiimPlot(int nIndex,SiimDataType dataType,PlotType nType,CSiimData *pData	,QWidget *parent)
	: QMdiSubWindow(parent)
{
	pRTplot = NULL;
	QHBoxLayout *layout =new QHBoxLayout;
	pInterWidget = new QWidget();
	setWidget(pInterWidget);
	if(nType == REALTIME)
	{
		pRTplot = new QRealTimePlot(nIndex,dataType,nType,pData);	
		layout->addWidget(pRTplot);
	}
	
	pInterWidget->setLayout(layout);
	
}

QSiimPlot::~QSiimPlot()
{
	if(pRTplot!=NULL)
		delete pRTplot;
	delete pInterWidget;
}



void QSiimPlot::SetTitle(QString strTitle)
{
	pRTplot->setTitle( strTitle );
}

void QSiimPlot::closeEvent(QCloseEvent *event)
{
	event->ignore();
}

